﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.Text;
using BlueLotus7.ArchiveSystem.Interfaces;
using BlueLotus7.Common;
using BlueLotus7.Contract;

namespace BlueLotus7.ArchiveSystem.Common
{
    [DataContract]
    public class ArchivedPerson : ArchivedObject, ICopyProperty<ArchivedPerson>
    {
        [DataMember]
        public DateTime? Birthday
        {
            get;
            set;
        }

        [DataMember]
        public Gender Gender
        {
            get;
            set;
        }

        [DataMember]
        public string Description
        {
            get;
            set;
        }

        [DataMember]
        public string AvatorUrl
        {
            get;
            set;
        }

        [DataMember]
        public byte[] AvatorData
        {
            get;
            set;
        }

        public virtual void CopyProperty(ArchivedPerson container, ArchivedPerson objectToCopy)
        {
            if (container != null && objectToCopy != null)
            {
                base.CopyProperty(container, objectToCopy);
                container.Birthday = objectToCopy.Birthday;
                container.Description = objectToCopy.Description;
                container.Gender = objectToCopy.Gender;
                container.AvatorUrl = objectToCopy.AvatorUrl;
                container.AvatorData = objectToCopy.AvatorData;
            }
        }
    }
}
